home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
xdsn217.zip
/
DOC
/
h2d.inf
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1996-07-09
|
53KB
|
1,756 lines
ΓòÉΓòÉΓòÉ 1. Disclaimer ΓòÉΓòÉΓòÉ
This on-line document was generated automatically from its printed version
LaTeX source. Some places in the document (especially tables) may look ugly due
to the conversion program limits. These problems are being worked on and are
supposed to be solved in the final release.
ΓòÉΓòÉΓòÉ 2. Title Page ΓòÉΓòÉΓòÉ
xTech Development System
H2D User's Guide
xTech Ltd, 1996
XDS software and documentation copyright (c) 1991-1996 xTech Ltd. (xTech).
Information in this document is subject to change without notice and does not
represent a commitment on the part of xTech.
All rights reserved. You may use the enclosed software on a single computer;
transfer the software from one computer to another, provided that the software
is used on only one computer at a time and that you remove any copies of the
software on the computer from which the copies were made; make copies of the
software for backup purposes only.
XDS software and documentation have been tested and reviewed. Nevertheless,
xTech makes no warranty or representation, either express or implied, with
respect to the software and documentation included with XDS. In no event will
xTech be liable for direct, indirect, special, incidental or consequential
damages resulting from any defect in the software or documentation included
with this product. In particular, xTech shall have no liability for any
programs or data used with this product, including the cost of recovering
programs or data.
XDS is a trademark of xTech Ltd.
All trademarks and copyrights mentioned in this documentation are the property
of their respective holders.
ΓòÉΓòÉΓòÉ 3. Introduction ΓòÉΓòÉΓòÉ
About H2D
Typographic conventions
ΓòÉΓòÉΓòÉ 3.1. About H2D ΓòÉΓòÉΓòÉ
Sooner or later, every Modula-2 programmer encounters four problems. These are:
absence, incompleteness, unportability, and low quality of libraries. At the
same time, C/C++ programmers usually have problems choosing from a huge set of
free, public domain, shareware, and commercial libraries of various purpose,
size, and quality which are in many cases portable or are available for a
number of platforms. Moreover, the Application Programming Interfaces (APIs) of
the most widely used software products (operating systems, database engines,
etc.), are defined in terms of the C programming language.
In order to use all this stuff from Modula-2, a programmer needs, first, a
Modula-2 compiler which supports C calling/naming conventions and a set of
types corresponding to C types, and, second, definition modules corresponding
to the C headers of the library/API. Finding a suitable compiler is not a very
big deal, but manual conversion of C headers turns to a real nightmare when it
comes to, say, the X Window API. That is why we created H2D.
H2D does the job automatically, i.e. translates C header files into Modula-2
definition modules. H2D is intended to be used with XDS version 2.10 or later
and is included in the XDS distribution package. However, the generated
definition modules may be used with any ISO-compliant Modula-2 compiler. The
required modifications are minor and may be done using text editor macros or a
simple REXX, sed, etc script.
The source language is a subset of ANSI C, which includes declarations and
preprocessor directives, with some extensions (See Non-standard qualifiers and
Chapter Non-standard preprocessor directives). Destination language is ISO
Modula-2 with XDS language extensions, but in XDS resulting definition modules
may be used with both Modula-2 and Oberon-2.
H2D generates definition modules suitable for either XDS-C, Native XDS, or
both. In case of Native XDS, module template for function-like C macros may be
generated (See Native code). In case of XDS-C, an extra header file containing
C declarations of types introduced by H2D is generated (See Convertor to C).
ΓòÉΓòÉΓòÉ 3.2. Typographic conventions ΓòÉΓòÉΓòÉ
Language descriptions
Source code fragments
ΓòÉΓòÉΓòÉ 3.2.1. Language descriptions ΓòÉΓòÉΓòÉ
Where formal descriptions for language syntax constructions appear, an extended
Backus-Naur Formalism (EBNF) is used.
These descriptions are set in the Courier font.
Text = Text [{Text}] | Text.
In EBNF, brackets [ and ] denote optionality of the enclosed expression, braces
{ and } denote repetition (possibly 0 times), and the line | denotes other
possible valid descriptions.
Non-terminal symbols start with an upper case letter (e.g. Statement). Terminal
symbols either start with a lower case letter (e.g. ident), or are written in
all upper case letters (e.g. BEGIN), or are enclosed within quotation marks
(e.g. ":=").
ΓòÉΓòÉΓòÉ 3.2.2. Source code fragments ΓòÉΓòÉΓòÉ
When fragments of a source code are used for examples or appear within a text
they are set in the Courier font.
/* example.h */
typedef unsigned long int UINT;
ΓòÉΓòÉΓòÉ 4. Configuring H2D ΓòÉΓòÉΓòÉ
System search path
Working configuration
Directory hierarchies
Redirection file
Configuration file
Customizing H2D messages
ΓòÉΓòÉΓòÉ 4.1. System search path ΓòÉΓòÉΓòÉ
In order that your operating system should know where to find the executable
binary files which constitute the H2D package, you have to setup your operating
system search path properly. Refer to the readme.1st file from the on-line
documentation.
ΓòÉΓòÉΓòÉ 4.2. Working configuration ΓòÉΓòÉΓòÉ
The H2D working configuration includes an executable file and a set of system
files:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
h2d.red Search path redirection file (See Redirection file)
h2d.cfg Configuration file (See Configuration file)
h2d.msg Contains texts of error messages (See Customizing H2D messages)
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
Upon invocation, H2D tries to locate the h2d.red file in the current directory.
If h2d.red is found, all other files are searched for/created using paths
defined in h2d.red, otherwise they are considered to reside in the current
directory.
The configuration file contains various H2D settings. If the configuration file
is not found, default settings are used.
ΓòÉΓòÉΓòÉ 4.3. Directory hierarchies ΓòÉΓòÉΓòÉ
H2D gives you complete freedom over where you keep your header files and any
files which H2D itself creates for further use. It is advisable to work in a
project oriented fashion - i.e. to have a separate directory hierarchy for each
individual project.
Each project should have a main working directory. The script called h2duser
can be used to create all required subdirectories and system files (e.g.
h2d.red). For example, to create a directory structure for a project called
myproj, issue the following commands:
md myproj
cd myproj
h2duser
H2D keeps the directory hierarchies of original header files. Usually the
directory containing header files has some subdirectories. All H2D output
directories must contain the same subdirectories. ???
ΓòÉΓòÉΓòÉ 4.4. Redirection file ΓòÉΓòÉΓòÉ
Upon activation, H2D looks for a file called h2d.red - the redirection file.
This file defines directories in which all other files are searched for. The
redirection file has to be placed in the current directory.
A redirection file consists of several lines of the form:
Pattern = directory {";" directory}
Pattern is a regular expression which all file names used by H2D will be
compared with. A regular expression is a string containing certain special
characters:
ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö